<?php
declare(strict_types=1);

namespace App;

class App
{
    public static ?App $app = null;
    public Config $config;

    public Server $server;

    protected function __construct()
    {
        $this->config = new Config($this);
        $this->server = new Server($this);
    }

    public function run(): void
    {
        $this->server->start();
    }

    public static function getApp(): App
    {
        if (self::$app === null) {
            self::$app = new App();
        }
        return self::$app;
    }

}